/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package opk.Graphics;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;



/**
 *
 * @author mikeqcp
 */
public class Menu extends JFrame implements KeyListener{

    JLabel labs[] = new JLabel[5];
    JTextField edits[] = new JTextField[5];
    GridLayout layout = new GridLayout(2,5);
    Panel panel = new Panel();

    

    public Menu()
    {
        super("Generator");
        this.setVisible(true);
        this.resize(new Dimension(500, 500));
//        this.setSize(500, 500);
        this.addKeyListener(this);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        panel.setSize(new Dimension(100, 100));
        this.add(panel);

        

        panel.setLayout(layout);


        labs[0] = new JLabel("Liczba wierzcholkow: ");
        labs[1] = new JLabel("Przecinanie (1-tak ; 0-nie): ");
        labs[2] = new JLabel("Min liczba wierzcholkow: ");
        labs[3] = new JLabel("Max liczba wierzcholkow: ");
        labs[4] = new JLabel("Promien wielkokata: ");

        for(int i=0; i<5; i++)
        {
            edits[i] = new JTextField(10);
            edits[i].addKeyListener(this);
            edits[i].setVisible(true);
        }


//        for(int i=0; i<5; i++)
//        {
//            this.add(labs[i]);
//            this.add(edits[i]);
//        }


        for(JLabel l : labs)
        {
            panel.add(l);
        }



        
    }

    
    public void keyTyped(KeyEvent e) {

    }

    public void keyPressed(KeyEvent e) {

    }

    public void keyReleased(KeyEvent e) {
        if(e.getKeyCode()==KeyEvent.VK_ESCAPE)
        {
            dispose();
            System.exit(0);
        }
    }


}
